package yto.freemarker.springcloud.service;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import yto.freemarker.springcloud.entity.User;

/**
 * @author dongxing
 * @create 2018-03-01 21:09
 **/
@FeignClient(name = "service-provider")
public interface UserService {

    @RequestMapping(value = "/user/{id}",method = RequestMethod.GET)
    // 两个坑：1. @GetMapping不支持   2. @PathVariable得设置value
    public User getUserById(@PathVariable("id") String id);

    @RequestMapping(value = "/user/post/1", method = RequestMethod.POST)
    public User postUser(@RequestBody User user);


}
